import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        // 默认首页-tab
        path: '/',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/home-page',
        children: [{
            path: '/home-page',
            component: () =>
                import ('@/views/HomePage/HomePage.vue')
        }]
    },
    {
        // 中心概况-tab
        path: '/center-overview',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/center-overview',
        children: [{
            // 中心简介
            path: '/center-overview',
            component: () =>
                import ('@/views/CenterOverview/CenterOverview.vue'),
            redirect: '/introduction-center',
            children: [{
                // 中心简介
                path: '/introduction-center',
                component: () =>
                    import ('@/views/CenterOverview/CenterChildren/IntroductionCenter.vue'),
                children: [{
                    // 师资团队
                    path: '/teachers-team',
                    component: () =>
                        import ('@/views/CenterOverview/CenterChildren/TeachersTeam.vue')
                }, {
                    // 申报材料
                    path: '/application-materials',
                    component: () =>
                        import ('@/views/CenterOverview/CenterChildren/ApplicationMaterials.vue')
                }, {
                    // 创新与发展
                    path: '/innovation-development',
                    component: () =>
                        import ('@/views/CenterOverview/CenterChildren/InnovationDevelopment.vue')
                }]
            }, ]
        }, ]
    },
    {
        // 中心动态-tab
        path: '/central-dynamics',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/central-dynamics',
        children: [{
            // 中心动态
            path: '/central-dynamics',
            component: () =>
                import ('@/views/CentralDynamics/CentralDynamics.vue')
        }, ]
    },
    {
        // 管理体系-tab
        path: '/management-system',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/management-system',
        children: [{
            // 管理体系
            path: '/management-system',
            component: () =>
                import ('@/views/ManagementSystem/ManagementSystem.vue'),
            redirect: '/security-management',
            children: [{
                    // 安全管理
                    path: '/security-management',
                    component: () =>
                        import ('@/views/ManagementSystem/SecurityManagement.vue')
                },
                {
                    // 设备管理
                    path: '/device-management',
                    component: () =>
                        import ('@/views/ManagementSystem/DeviceManagement.vue')
                },
                {
                    // 实验室管理
                    path: '/lab-management',
                    component: () =>
                        import ('@/views/ManagementSystem/LabManagement.vue')
                },
            ]
        }, ]
    },
    {
        // 教学科研-tab
        path: '/teaching-research',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/teaching-research',
        children: [{
            // 教学科研
            path: '/teaching-research',
            component: () =>
                import ('@/views/TeachingResearch/TeachingResearch.vue'),
            redirect: '/teaching-equipment',
            children: [{
                    // 教学设备
                    path: '/teaching-equipment',
                    component: () =>
                        import ('@/views/TeachingResearch/TeachingEquipment.vue')
                },
                {
                    // 资源共享
                    path: '/resource-sharing',
                    component: () =>
                        import ('@/views/TeachingResearch/ResourceSharing.vue')
                },
                {
                    // 教学成果
                    path: '/teaching-achievements',
                    component: () =>
                        import ('@/views/TeachingResearch/TeachingAchievements.vue')
                },
                {
                    // 下载中心
                    path: '/download-center',
                    component: () =>
                        import ('@/views/TeachingResearch/DownloadCenter.vue')
                }
            ]
        }, ]
    },
    {
        // 在线学习-tab
        path: '/online-learning',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/online-learning',
        children: [{
            // 在线学习
            path: '/online-learning',
            component: () =>
                import ('@/views/Onlinelearning/Onlinelearning.vue')
        }, ]
    },
    {
        // 在线留言-tab
        path: '/online-message',
        component: () =>
            import ('@/views/LayoutPage/LayoutPage.vue'),
        redirect: '/online-message',
        children: [{
            // 在线留言
            path: '/online-message',
            component: () =>
                import ('@/views/OnlineMessage/OnlineMessage.vue')
        }, ]
    }
]

const router = new VueRouter({
    routes,
    mode: 'history'
})

// 导出路由
export default router;